Primary keys: can they be alphanumerical?

Поиск
Список
Период
Сортировка
От Stuart Rison
Тема Primary keys: can they be alphanumerical?
Дата
Msg-id l03110707b1c67506245f@[128.40.242.190]
обсуждение исходный текст
Ответы Re: [SQL] Primary keys: can they be alphanumerical?  ("Brett W. McCoy" <bmccoy@lan2wan.com>)
Список pgsql-sql
Dear All,

I'm using postgreSQL to create a database of breast cancer patient data.  I
am currently designing my tables.

I would like to know what is the general concensus on having alphanumerical
primary keys.

The reason for this is that, with a 15 character long alphanumerical key, I
could include hidden information in the key which could help users to
quickly get information without even having to search the database.  For
example, the first to characters could be a two-letter code for the
refering hospital, the next four a numerical patient number and subsequent
characters refer to treating  clinicians etc.

Is this a major 'faux-pas'?  Am I introducing unwanted redundancy in the
key?  Will it make indexing a lot slower?  Should primary keys be purely
numerical?

I would be grateful for any comments/suggestions.

Best regards,

Stuart.

PS.  could you cc me a copy of your posting(s).


+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
| Tel. (0171) 878 4041    | Courtauld Building                   |
| Fax. (0171) 878 4040    | 91 Riding House Street               |
+-------------------------+ London, W1P 8BT                      |
| stuart@ludwig.ucl.ac.uk | UNITED KINGDOM.                      |
+-------------------------+--------------------------------------+



В списке pgsql-sql по дате отправления:

Предыдущее
От: Barracuda
Дата:
Сообщение: Thanks
Следующее
От: Stuart Rison
Дата:
Сообщение: How to split very long tables?